import MyCar.Car;
import MyCar.FactoryCar;

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<Car> carList=new ArrayList<Car>();
        carList.add(FactoryCar.getcar("宝马"));
        carList.add(FactoryCar.getcar("奔驰"));
        carList.add(FactoryCar.getcar("兰博基尼"));

        for(Car current:carList){
            System.out.println(current.showCarName());
        }
    }
}